-
-
Notifications
You must be signed in to change notification settings - Fork 0
Remove Feed::label() and Feed::url()
#30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces PHPStan static analysis tooling at maximum strictness level to improve type safety and code quality. The changes focus on replacing loose type coercion with explicit type checking and validation throughout the codebase.
- Added PHPStan configuration with strict rules and deprecation checking
- Refactored the
Feedenum to use backed enum values, eliminating the need for separatelabel()andurl()methods - Enhanced type safety across factory classes with explicit type validation and PHPDoc annotations
Reviewed Changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| phpstan.neon | New PHPStan configuration file enabling maximum strictness level |
| composer.json | Added PHPStan packages and configured lint script with static analysis |
| .github/workflows/lint.yml | Enabled PHPStan checking in CI pipeline |
| src/Feed.php | Converted to backed enum using URL strings as values |
| src/Client.php | Updated to use backed enum value and added type guard for array elements |
| src/Exceptions/InvalidJsonException.php | Changed from label() method to name property |
| src/Exceptions/HttpException.php | Changed from label() method to name property |
| tests/Feature/TestCase.php | Updated fixture path to use name property instead of label() method |
| src/RecordFactory.php | Added PHPDoc annotations and replaced loose type coercion with explicit validation |
| src/SoftwareFactory.php | Added PHPDoc annotations and explicit type checking for all inputs |
| src/CvssFactory.php | Enhanced type validation with support for numeric score conversion |
| src/CopyrightFactory.php | Replaced loose type coercion with explicit string type checks |
| src/AffectedVersionsParser.php | Removed unused constant and improved constraint filtering logic |
| src/Record.php | Added missing PHPDoc annotation for references parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| try { | ||
| return $this->http->get($feed->url()); | ||
| return $this->http->request('GET', $feed->value); |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The HTTP method is now explicitly specified as 'GET' instead of using the dedicated get() method. While functionally equivalent, using $this->http->get($feed->value) would be more idiomatic and clearer in intent. The get() method is the standard Guzzle approach for GET requests.
| return $this->http->request('GET', $feed->value); | |
| return $this->http->get($feed->value); |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
============================================
- Coverage 89.15% 88.50% -0.66%
+ Complexity 83 77 -6
============================================
Files 13 12 -1
Lines 212 200 -12
============================================
- Hits 189 177 -12
Misses 23 23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.